

#include<QWidget>
#include <QtWidgets/QApplication>

#include"init_widget.h"

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    Q3DBars bars;
    init_widget init(&bars);
    bars.setFlags(bars.flags() ^ Qt::FramelessWindowHint);
    bars.rowAxis()->setRange(0, 4);
    bars.columnAxis()->setRange(0, 4);
    QBar3DSeries *series = new QBar3DSeries;


    QBarDataRow *data = new QBarDataRow;
    *data << 1.0f << 3.0f << 7.5f << 5.0f << 2.2f;
    QBarDataRow *data1 = new QBarDataRow;
    *data1 << 2.9f << 4.5f << 6.5f << 4.0f << 5.2f;
    QBarDataRow *data2 = new QBarDataRow;
    *data2 << 4.7f << 3.3f << 2.5f << 5.6f << 2.9f;
    QBarDataRow *data3 = new QBarDataRow;
    *data3 << 5.0f << 2.8f << 6.5f << 4.9 << 6.8f;
    series->dataProxy()->addRow(data);
    series->dataProxy()->addRow(data1);
    series->dataProxy()->addRow(data2);
    series->dataProxy()->addRow(data3);
    //QFont


    bars.addSeries(series);
    QValue3DAxis *value=new QValue3DAxis;
    value->setTitle("Average temperature");
    value->setTitleVisible(true);
    value->setSegmentCount(3);
    value->setSubSegmentCount(2);
    value->setLabelFormat(QString(QStringLiteral("%.2f ") + "C"));
    value->setLabelAutoRotation(30.0f);
    bars.setValueAxis(value);
    QCategory3DAxis *axis=new QCategory3DAxis;
    QStringList list;
    list<<"周一"<<"周二"<<"周三"<<"周四";
    axis->setLabels(list);
    axis->setLabelAutoRotation(30.0f);
    bars.setRowAxis(axis);
    bars.show();
    init.show_widget();


    return app.exec();
}
